package com.mz.mattress.api.enums;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 文件名前缀，sfz身份证 ht合同 xsz行驶证 djzs登记证书 wts委托书 yyzz营业执照 rl人脸
 * 文件名前缀，1身份证 2合同 3行驶证 4登记证书 5委托书 6营业执照 7人脸
 */
@Getter
public enum FilePrefixEnum {

    //身份证
    Ident(1, "sfz"),
    //合同
    Contract(2, "ht"),
    //行驶证
    DriveLicense(3, "xsz"),
    //登记证书
    RegCert(4, "djzs"),
    //委托书
    Proxy(5, "wts"),
    //营业执照
    BusinessLicense(6, "yyzz"),
    //人脸
    Face(7, "rl"),
    //发票
    Invoice(8, "fp"),
    //车辆收购委托单
    BuyProxy(9, "sgwtd"),
    //车辆销售委托单
    SellProxy(10, "xswtd"),
    //打款凭证
    PayProof(11, "dkpz"),
    ;

    private Integer value;

    private String prefix;

    FilePrefixEnum(Integer value, String prefix) {
        this.value = value;
        this.prefix = prefix;
    }

    private static Map<Integer, FilePrefixEnum> map = new HashMap<>();

    static {
        for (FilePrefixEnum filePrefixEnum : FilePrefixEnum.values()) {
            map.put(filePrefixEnum.value, filePrefixEnum);
        }
    }

    public static FilePrefixEnum valueOf(Integer value) {
        return map.get(value);
    }
}
